package cc.yugu.yhdw.webserver.persistence.hdw;

import cc.yugu.yhdw.common.domain.hdw.Agency;
import cc.yugu.yhdw.common.domain.hdw.AgencyInfo;
import cc.yugu.yhdw.common.persistence.MasterMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 代理商信息
 * 
 * @Date:Created in 2018/6/29 17:32
 * @Author:
 * @Modified By: zjn 2018/6/29 17:32
 */ 
public interface AgencyMapper extends MasterMapper {
    /**
    * 根据主键id查询表hdw_agency
    *
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.hdw.Agency
    * @Author By: zjn 2018/6/29  17:33
    */
    public Agency find(int id);
    /**
    * 根据主键id查询表hdw_agency
    *
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.hdw.AgencyInfo
    * @Author By: zjn 2018/6/29  17:33
    */
    public AgencyInfo findInfo(int id);
    /**
    * 按条件查询
    *
    * @Param: [agentId, activeFlag]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.Agency>
    * @Author By: zjn 2018/6/29  17:34
    */
    public List<Agency> findByAgent(@Param("agentId")Integer agentId,@Param("activeFlag")int activeFlag);
    /**
    * 按条件查询，并返回对应行数
    *
    * @Param: [search]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:35
    */
    public int findPageCount(Agency search);
    /**
    * 按条件分页查询
    *
    * @Param: [search]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.Agency>
    * @Author By: zjn 2018/6/29  17:36
    */
    public List<Agency> findPageResult(Agency search);
    /**
    * 插入
    *
    * @Param: [agency]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:36
    */
    public int insert(Agency agency);
    /**
    * 根据主键id更新
    *
    * @Param: [agency]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:36
    */
    public int update(Agency agency);
    /**
    * 按条件更新表中 启用标识
    *
    * @Param: [id, agentId, activeFlag]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:36
    */
    public int disable(@Param("id")Integer id,@Param("agentId")Integer agentId,@Param("activeFlag")int activeFlag);
    /**
    * 更新余额
    *
    * @Param: [id, balance]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:37
    */
    public int updateBalance(@Param("id") Integer id, @Param("balance") Integer balance);
    /**
    * 根据运营商id删除
    *
    * @Param: [agentId]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:37
    */
    public int deleteByAgent(int agentId);
    /**
    * 根据主键id删除
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/6/29  17:37
    */
    public int delete(int id);
}
